﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EasyStep.TestExecution.Interfaces;

using OpenQA.Selenium;

using OpenQA.Selenium.Firefox;
using OpenQA.Selenium.Chrome;
using OpenQA.Selenium.Remote;
using OpenQA.Selenium.IE;
using OpenQA.Selenium.Safari;
using EasyStep.Business.Interfaces;
using EasyStep.Business.Interfaces.Managers;
using EasyStep.Business;
using log4net;
using EasyStep.Data.Entities;

namespace EasyStep.TestExecution
{
    public class TestExecutionContext : IExecuteDataContext
    {
        public ITestActionManager ActionManager { get; set; }
        public ITestConstantManager ConstantsManager { get; set; }
        public ITestStepManager TestStepManager { get; set; }
        public ITestInfoManager TestInfoManager { get; set; }
        public ITestHistoryManager TestHistoryManager { get; set; }
        public IWebBrowserProxy[] RegisteredBrowsers { get; set; }
        public string CurrentProject { get; set; }
        public string CurrentTest { get; set; }
        public string CurrentSessionName { get; set; }
        public IWebBrowserProxy BrowserInfo { get; set; }
        public object BrowserInstance { get; set; }

        public TestExecutionContext(ITestDataContext dataContext, IWebBrowserProxy browser, string sessionName)
        {
            this.ActionManager = dataContext.ActionManager;
            this.ConstantsManager = dataContext.ConstantsManager;
            this.TestInfoManager = dataContext.TestInfoManager;
            this.TestStepManager = dataContext.TestStepManager;
            this.RegisteredBrowsers = dataContext.RegisteredBrowsers;
            this.CurrentTest = dataContext.CurrentTest;
            this.CurrentProject = dataContext.CurrentProject;
            this.PathReplacements = dataContext.PathReplacements;
      
            this.BrowserInfo = browser;
            this.CurrentSessionName = sessionName;
            this.TestHistoryManager = dataContext.TestHistoryManager;
            this.Log = LogManager.GetLogger("test_runner");
        }

        public ILog Log { get; set; }
        public Dictionary<string, string> PathReplacements { get; set; }
        public string Environment { get; set; }


        
    }
}
